#include <string>
#include <regex>
#include <iostream>
using namespace std;

int range( int min, int max ) {
    if( min == max ) {
        return min;
    }
    int dt = max - min;
    return min  +rand() % dt;
}

int main(int argc, char *argv[] ){

    string str = "1234\r\n1234\n1234";
    regex r( "\\r\\n|\\n" );
    int n = 0;
    const std::sregex_iterator end;
    for ( std::sregex_iterator iter( std::begin( str ), std::end( str ), r ); iter != end; ++iter )
    {
        n++;
        std::cout <<  "\"" << *iter->begin()  << "\"" << std::endl;
    }
    int count = str.size() - n;


    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;
    cout << range( -20, 20 ) << endl;

    cin.get();
    return 0;
}